//
//  InformationTableViewCell.m
//  ceshi
//
//  Created by liutaifeng on 16/5/18.
//  Copyright © 2016年 liutaifeng. All rights reserved.
//

#import "InformationTableViewCell.h"
#import "Common.h"
@interface InformationTableViewCell ()

@property (nonatomic, strong) UIImageView *picImageView;
@property (nonatomic, strong) UIView *lineView;
@end


@implementation InformationTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}
- (void)createView {
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_titleLabel];
    
    self.detailLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_detailLabel];
    
    self.picImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:_picImageView];
    
    self.lineView = [[UIView alloc] init];
    [self.contentView addSubview:_lineView];
    
}
- (void)layoutSubviews {
    [super layoutSubviews];
    if (self.isBooL == 0) {
        _titleLabel.frame = CGRectMake(0, 0, MAIN_WIDTH / 4, MAIN_HEIGHT / 4 * 3 / 11);
        _titleLabel.textAlignment = NSTextAlignmentLeft;
        _titleLabel.center = CGPointMake(MAIN_WIDTH / 6, MAIN_HEIGHT / 4 * 3 / 11 / 2);
//        NSLog(@"%f", self.contentView.frame.size.height);
//        NSLog(@"%f", _titleLabel.frame.origin.x);
//        NSLog(@"%f", _titleLabel.frame.size.height);
        
        _titleLabel.font = [UIFont systemFontOfSize:16];
        _detailLabel.frame = CGRectMake(0, 0, MAIN_WIDTH / 2, MAIN_HEIGHT / 4 * 3 / 11 / 4 * 3);
        _detailLabel.textAlignment = NSTextAlignmentRight;
        _detailLabel.center = CGPointMake([CalculateFrameView setWidth:260], self.contentView.center.y);
        _detailLabel.textColor = [UIColor lightGrayColor];
        _picImageView.frame = CGRectMake(MAIN_WIDTH / 6 * 5, 0, MAIN_WIDTH / 15, MAIN_HEIGHT / 4 * 3 / 11 / 2 );
        [_picImageView setImage:[UIImage imageNamed:@"xiangqian.png"]];
        _picImageView.center = CGPointMake(MAIN_WIDTH / 12 * 11, self.contentView.center.y);
        
        _lineView.frame = CGRectMake(0, self.contentView.frame.size.height - 1, self.contentView.frame.size.width, 1);
        
        _lineView.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1];
    }
    else {
        self.contentView.backgroundColor = LIGHT_GRAY;
    }
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
